//
//  WJIndexTwoTableViewCell.m
//  天气
//
//  Created by dllo on 16/8/23.
//  Copyright © 2016年 WJ. All rights reserved.
//
// 2个 collectionView
#import "WJIndexTwoTableViewCell.h"
#import "WJTitleLable.h"
#import "BezierCurveView.h"

#define kWJWidth  [UIScreen mainScreen].bounds.size.width
#define kWJHeight [UIScreen mainScreen].bounds.size.height

@interface WJIndexTwoTableViewCell ()

@property (nonatomic, strong)  BezierCurveView *dayView;

@property (nonatomic, strong) BezierCurveView *nightView;

@end


@implementation WJIndexTwoTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.35];
        [self createView];
        
    }
    return self;
}

- (void)createView
{
    WJTitleLable *contentLabel = [[WJTitleLable alloc]initWithFrame:CGRectMake(20, 0, kWJWidth - 40, 30)];
    contentLabel.text = @"未来天气";
    contentLabel.textAlignment = 0;
    [self.contentView addSubview:contentLabel];
    
    self.firstCollection = [[WJIndexTwoOfFirstCollection alloc]initWithFrame:CGRectMake(0, 40, kWJWidth, 50)];
    [self.contentView addSubview:self.firstCollection];
    
    self.sectionCollectionView = [[WJIndexTwoOfSecondView alloc]initWithFrame:CGRectMake(0, 100, kWJWidth, 70)];
    [self.contentView addSubview:self.sectionCollectionView];
    
    
    self.dayView = [[BezierCurveView alloc]initWithFrame:CGRectMake(0, 200, kWJWidth, 120)];
    [self.contentView addSubview:self.dayView];
    
    self.nightView = [[BezierCurveView alloc]initWithFrame:CGRectMake(0, 320, kWJWidth, 100)];
    [self.contentView addSubview:self.nightView];

    
    self.thirdCollectionView = [[WJIndexTwoOfThirdView alloc]initWithFrame:CGRectMake(0, 420, kWJWidth, 70)];
    [self.contentView addSubview:self.thirdCollectionView];

    
}

- (void)setDayArray:(NSMutableArray *)dayArray
{
    _dayArray = dayArray;
    
    [self.dayView removeFromSuperview];
    
    self.dayView = [[BezierCurveView alloc]initWithFrame:CGRectMake(0, 200, kWJWidth, 120)];
    [self.contentView addSubview:self.dayView];

    self.dayView.yArray = dayArray;
    
    [self.dayView dravLine];
}


- (void)setNightArray:(NSMutableArray *)nightArray
{
    _nightArray = nightArray;
    
    [self.nightView removeFromSuperview];
    
    self.nightView = [[BezierCurveView alloc]initWithFrame:CGRectMake(0, 320, kWJWidth, 100)];
    [self.contentView addSubview:self.nightView];
    
    self.nightView.yArray = nightArray;
    
    [self.nightView dravLine];
}







@end
